package permission

import (
	"github.com/APP/internal/handler"
	"github.com/gin-gonic/gin"
)

// RegisterPermissionRoutes 注册权限相关路由
func RegisterPermissionRoutes(r *gin.RouterGroup) {
	permissionHandler := handler.NewPermissionHandler()

	// 权限管理路由组
	permissionGroup := r.Group("/permissions")
	{
		// 获取权限列表
		permissionGroup.GET("", permissionHandler.GetPermissionList)

		// 获取权限树
		permissionGroup.GET("/tree", permissionHandler.GetPermissionTree)

		// 创建权限
		permissionGroup.POST("", permissionHandler.CreatePermission)

		// 获取权限详情
		permissionGroup.GET("/:id", permissionHandler.GetPermission)

		// 更新权限
		permissionGroup.PUT("/:id", permissionHandler.UpdatePermission)

		// 删除权限
		permissionGroup.DELETE("/:id", permissionHandler.DeletePermission)

		// 批量删除权限
		permissionGroup.DELETE("/batch", permissionHandler.BatchDeletePermissions)
	}
}
